import Vue from 'vue'
import Classification from '@/views/Classification'
import HomePage from '@/views/HomePage'
import My from '@/views/My'
import OrderForm from '@/views/OrderForm'

// 1.引入
import VueRouter from 'vue-router'
// 2.让vue使用VueRouter这个插件
Vue.use(VueRouter)
// 3.创建vue实例
const router = new VueRouter({
  // router是一个数组，数组里面的每一个对象都是一条路由规则
  routes: [
     // 网页打开默认显示 - 首页部分 重定向到/HomePage
    {
      path: '/',
      redirect: '/HomePage',
    },
    {
      //路径  组件
      path: '/Classification',
      component: Classification,
    },
    {
      path: '/HomePage',
      component: HomePage,
    },
    {
      path: '/My',
      component: My,
    },
    {
      path: '/OrderForm',
      component: OrderForm,
    },
  ],
})
export default router
